<div navbar ng-init="currentItem='utils'"></div>
<div ng-show="!loaded"><div loading></div></div>

<div id="main" ng-show="loaded" style="display:none">
	<div class="module-header">
		<h3>系统管理</h3>
	</div>
	<div ng-init="checkVirt()">
		<table class="table">
			<thead>
				<tr>
					<th colspan="3">通用设置</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td style="width:120px;">用户管理</td>
					<td style="width:380px;" class="muted">管理系统用户、用户组、和用户密码</td>
					<td style="width:100px;"><a class="btn btn-default btn-sm" href="#/utils/user">进入管理</a></td>
                </tr>
                <tr>
                    <td>进程管理</td>
					<td class="muted">管理系统当前运行的所有进程</td>
					<td><a class="btn btn-default btn-sm" href="#/utils/process">进入管理</a></td>
                </tr>
				<tr>
					<td>网络设置</td>
					<td class="muted">设置 IP 地址、网关、DNS服务器</td>
					<td><a class="btn btn-default btn-sm" href="#/utils/network">进入设置</a></td>
				</tr>
				<tr>
					<td>时间设置</td>
					<td class="muted">设置服务器的时间和时区</td>
					<td><a class="btn btn-default btn-sm" href="#/utils/time">进入设置</a></td>
				</tr>
				<tr style="display:none;" ng-show="virt != 'Virtuozzo/OpenVZ' && virt != '?'">
					<td>磁盘分区</td>
					<td class="muted">对磁盘进行分区、格式化、挂载等操作</td>
					<td><a class="btn btn-default btn-sm" href="#/utils/partition">进入设置</a></td>
				</tr>
			</tbody>
		</table>
		<table class="table">
			<thead>
				<tr>
					<th colspan="3">安全增强</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td style="width:120px;">SSH公钥验证</td>
					<td style="width:380px;" class="muted">防暴力破解，使用更安全的公钥验证替换密码验证</td>
					<td style="width:100px;"><a class="btn btn-default btn-sm" href="#/service/ssh?s=pubkauth">进入设置</a></td>
				</tr>
				<tr>
					<td>网络端口开关</td>
					<td class="muted">利用 Linux 防火墙实现网络端口的开关</td>
					<td><a class="btn btn-default btn-sm" ng-disabled="true" href="#/utils">即将发布</a></td>
				</tr>
			</tbody>
		</table>
		<table class="table">
			<thead>
				<tr>
					<th colspan="3">服务器初始化</th>
				</tr>
			</thead>
			<tbody>
				<tr style="display:none" ng-show="virt != 'Virtuozzo/OpenVZ' && virt != '?'">
					<td style="width:120px;">自动格式化挂载</td>
					<td style="width:380px;" class="muted">对未挂载的磁盘进行格式化并自动挂载</td>
					<td style="width:100px;"><a class="btn btn-default btn-sm" href="#/utils/autofm">进入设置</a></td>
				</tr>
				<tr>
					<td>数据移至数据盘</td>
					<td class="muted">将数据迁移至数据盘，并通过链接保持原路径</td>
					<td><a class="btn btn-default btn-sm" href="#/utils/movedata">进入设置</a></td>
				</tr>
			</tbody>
		</table>
		<table class="table">
			<thead>
				<tr>
					<th colspan="3">服务器重启</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td style="width:120px;">重启服务器</td>
					<td style="width:380px;" class="muted">重启您的服务器</td>
					<td style="width:100px;"><button class="btn btn-default btn-sm" ng-click="rebootconfirm()">立即重启</button></td>
				</tr>
			</tbody>
		</table>
	</div>
</div>

<div id="rebootconfirm" class="modal fade">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h3>服务器重启确认</h3>
            </div>
            <div class="modal-body">
                <div class="alert alert-info">
                    <p>重启过程中，您的服务器将会持续中断服务！</p>
                    <p>确认要重启服务器吗？</p>
                </div>
                <div class="input-group">
                    <span class="input-group-addon">请输入大写的 OK 确认重启</span>
                    <input type="text" class="form-control" max-length="2" ng-model="confirmok" placeholder="输入 OK">
                </div>
            </div>
            <div class="modal-footer">
                <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">取消</button>
                <button class="btn btn-danger" onclick="$('#rebootconfirm').modal('hide')" ng-disabled="confirmok!='OK'" ng-click="reboot()">确定重启</button>
            </div>
        </div>
    </div>
</div>
